﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Flight Schedule.aspx.cs" Inherits="Flight_Schedule" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:content id="Content2" contentplaceholderid="ContentPlaceHolder1" runat="Server">
    <h2>
        Flight Schedule</h2>
    <div style="width: 100%">
        <asp:gridview id="GridView1" runat="server" allowpaging="True" allowsorting="True"
            autogeneratecolumns="False" datasourceid="SqlDataSource1" width="100%">
            <columns>
                    <asp:BoundField DataField="CityFrom" HeaderText="From" 
                        SortExpression="CityFrom" >
                    <ItemStyle BackColor="#99FFCC" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CountryFrom" HeaderText="Country" 
                        SortExpression="CountryFrom" >
                    <ItemStyle BackColor="#99FFCC" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CityTo" HeaderText="To" SortExpression="CityTo" >
                    <ItemStyle BackColor="#CC99FF" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CountryTo" HeaderText="Country" 
                        SortExpression="CountryTo" >
                    <ItemStyle BackColor="#CC99FF" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DepartTime" DataFormatString="{0:t}" 
                        HeaderText="Depart Time" SortExpression="DepartTime" >
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FlyHour" HeaderText="Fly Hours" 
                        SortExpression="FlyHour" >
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DayofWeek" HeaderText="Day of Week" 
                        SortExpression="DayofWeek" >
                    <ItemStyle BackColor="#B7CBEB" />
                    </asp:BoundField>
                </columns>
            <emptydatatemplate>
                    No Data Found
                </emptydatatemplate>
        </asp:gridview>
        <br />
        <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:sqlString %>"
            selectcommand="SELECT Airline_Schedule.DayofWeek, Airline_Schedule.DepartTime, Airline_Route.FlyHour, Airline_Cities.[City Name] AS CityFrom, Airline_Cities_1.[City Name] AS CityTo, Airline_Cities_1.Country AS CountryTo, Airline_Cities.Country AS CountryFrom FROM Airline_Cities INNER JOIN Airline_Route ON Airline_Cities.CityID = Airline_Route.OriginalCityID INNER JOIN Airline_Schedule ON Airline_Route.RouteID = Airline_Schedule.RouteID INNER JOIN Airline_Cities AS Airline_Cities_1 ON Airline_Route.DestinationCityID = Airline_Cities_1.CityID">
        </asp:sqldatasource>
    </div>
</asp:content>
